/api/user/files/:id
View, update, or delete a specific file you own (by ID or filename).
Info
This endpoint requires authentication.
Path Parameters
Parameter | Type | Description |
---|---|---|
id | string | Required. File ID or filename. |
GET Request
Response
Status: 200 OK
Content-Type: application/json
Returns a File object.
PATCH Request
Update file properties (favorite status, max views, password, tags, etc).
Body
Content-Type: application/json
Property | Type | Description |
---|---|---|
favorite | boolean? | Set/unset as favorite. |
maxViews | number? | Max allowed views (>= 0 ). |
password | string?~ | Set password (string), remove password (null or empty string). |
originalName | string? | Set or update the original filename. |
type | string? | Set or update the file MIME type. |
tags | string[]? | Array of tag IDs to set for this file. |
Example
{"favorite": true,"maxViews": 100,"password": "newpassword","originalName": "newfile.txt","type": "text/plain","tags": ["tag1", "tag2"]}
Response
Status: 200 OK
Content-Type: application/json
Returns an updated File object.
Error Responses
-
400 Bad Request
- If the request body is invalid or missing required fields
- Number fields are invalid or out of range
- Tags provided are invalid or do not exist
-
404 Not Found
- If the file with the specified ID or filename does not exist
- If the file does not belong to the authenticated user
DELETE Request
Delete a specific file by ID or filename.
Response
Status: 200 OK
Content-Type: application/json
Returns a File object representing the deleted file.
Error Responses
-
404 Not Found
- If the file with the specified ID or filename does not exist
- If the file does not belong to the authenticated user
/api/user/files
List and search files for the authenticated user (with pagination, sor...
/api/user/files/:id/password
Verify the password for a password-protected file.
Last updated: 6/1/2025
Edit this page on GitHub